<ion-header>
  <ion-navbar>
    <ion-title>MQTT接入</ion-title>
  </ion-navbar>
</ion-header>
<ion-content padding>
  <div *ngIf="!showKey">
    <p>blinker支持国内外多个服务商的iot套件</p>
    <p>点击选择你要使用的服务提供商</p>
    <ion-grid>
      <ion-row>
        <!-- <ion-col col-6>
          <img src="assets/img/onenet-button.png" (tap)="registerDevice('aliyun')" />
        </ion-col> 
        <ion-col col-6>
          <img src="assets/img/aliyun-button.png" />
          <img unsupport src="assets/img/null-button.png" />
        </ion-col> -->
        <ion-col col-6>
          <img src="assets/img/aliyun-button.png" (tap)="registerDevice('aliyun')" />
        </ion-col>
        <ion-col col-6>
          <img src="assets/img/onenet-button.png" />
          <img unsupport src="assets/img/null-button.png" />
        </ion-col>
        <ion-col col-6>
          <img src="assets/img/qcloud-button.png" />
          <img unsupport src="assets/img/null-button.png" />
        </ion-col>
        <ion-col col-6>
          <img src="assets/img/baidu-button.png" />
          <img unsupport src="assets/img/null-button.png" />
        </ion-col>
        <ion-col col-6>
          <img src="assets/img/aws-button.png" />
          <img unsupport src="assets/img/null-button.png" />
        </ion-col>
        <ion-col col-6>
          <img src="assets/img/google-button.png" />
          <img unsupport src="assets/img/null-button.png" />
        </ion-col>
      </ion-row>
    </ion-grid>
  </div>

  <ion-card *ngIf="showKey">
    <ion-card-content height60>
      <!-- <img *ngIf="showBroker=='aliyun'" src="assets/img/onenet-button.png" /> -->
      <img *ngIf="showBroker=='aliyun'" src="assets/img/aliyun-button.png" />
      <img *ngIf="showBroker=='qcloud'" src="assets/img/qcloud-button.png" />
      <br />
      <!-- <p>已成功将设备注册到:</p> -->
      <br />
      <!-- <div keyvalue selectable>{{showBroker}}</div> -->
      <br />
      <p>复制以下Secret Key到你的源程序中：</p>
      <br />
      <div keyvalue selectable>{{secretKey}}</div>
      <button ion-button small clear right (click)="copyKey()">复制key</button>

    </ion-card-content>
  </ion-card>
  <button *ngIf="showKey" ion-button gotohome full (click)="gotoHome()">返回我的设备</button>
</ion-content>